package com.qc.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qc.dao.CouponDao;
import com.qc.entity.Coupon;
import com.qc.service.CouponService;

@Service("couponService")
public class CouponServiceImpl implements CouponService{

	@Resource(name="couponDao")
	private CouponDao couponDao;
	
	@Override
	public int saveCoupon(Coupon coupon) {

		return couponDao.saveCoupon(coupon);
	}

	@Override
	public int deleteCouponId(long id) {

		return couponDao.deleteCouponId(id);
	}

	@Override
	public int updateCouponId(Coupon coupon) {

		return couponDao.updateCouponId(coupon);
	}

	@Override
	public List<Coupon> listAllUserId(long userId, String state) {

		return couponDao.listAllUserId(userId, state);
	}

	@Override
	public List<Coupon> listAllShopId(long userId,long shopId) {

		return couponDao.listAllShopId(userId,shopId);
	}

	@Override
	public int getListCouponCount(String name, long shopId) {

		return couponDao.getListCouponCount(name, shopId);
	}

	@Override
	public List<Coupon> getAllCoupon(String name, long shopId, int pageNo, int pageSize) {

		return couponDao.getAllCoupon(name, shopId, pageNo, pageSize);
	}

	@Override
	public int updateState(long bId, String state) {

		return couponDao.updateState(bId, state);
	}

	@Override
	public List<Coupon> listAllCouponType() {
		
		return couponDao.listAllCouponType();
	}
	
	@Override
	public List<Coupon> listAllCouponOverdueState() {
		
		return couponDao.listAllCouponOverdueState();
	}

	@Override
	public Coupon getByCouponId(long bId) {

		return couponDao.getByCouponId(bId);
	}

}
